<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	               "http://www.w3.org/TR/html4/loose.dtd">
<%
String atributoNombre = TINTContabilidadController.KEY_CONTEXT;
TINTContabilidadController b = (TINTContabilidadController) session.getAttribute(atributoNombre);
Empresa emp = b.getEmpresaSesion();
List<Rubro> rubros = emp.getRubros();
%>
<%@page import="com.tecnoin.tintconta.core.TINTContabilidadController"%>
<%@page import="com.tecnoin.tintconta.core.entities.Empresa"%>
<%@page import="java.util.List"%>
<%@page import="com.tecnoin.tintconta.core.entities.Rubro"%>
<%@page import="java.util.Iterator"%>
<%@page import="com.tecnoin.tintconta.core.entities.Cuenta"%><html>
  <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    	<title>Menu Principal</title>
	<link rel="stylesheet" href="./lib/css/jquery.treeview.css" />
	<link rel="stylesheet" href="./lib/css/screen.css" />
	
	<script src="./lib/jquery.js" type="text/javascript"></script>
	<script src="./lib/jquery.cookie.js" type="text/javascript"></script>
	<script src="./lib/jquery.treeview.js" type="text/javascript"></script>
	
	<script type="text/javascript" src="./lib/demo.js"></script>
  </head>
  <body>
	<jsp:include page="ajaxTecnoin.jsp"></jsp:include>
	<table>
	<tr>
		<td valign="top">
			<div id="treecontrol">
				<a title="Collapse the entire tree below" href="#"><img src="./images/minus.gif" /> Collapse All</a>
				<a title="Expand the entire tree below" href="#"><img src="./images/plus.gif" /> Expand All</a>
				<a title="Toggle the tree below, opening closed branches, closing open branches" href="#">Toggle All</a>
			</div>
			<ul id="black" class="filetree"> <!--  class="treeview-black"-->
			<li class="closed"> <span class="folder"> Catalogo de Cuentas </span> <ul>
			<%
			Iterator<Rubro> iRubros = rubros.iterator();
			while(iRubros.hasNext())
			{
				Rubro r = iRubros.next();
				%>
				
				<li class="closed"> <span class="folder"><%= r.getNombre() %></span>
					<ul>
				<%
				Iterator<Cuenta> iCuentas = r.getCuentas().iterator();
				while(iCuentas.hasNext())
				{
					Cuenta cta = iCuentas.next();
					%>
					<li> <span class="file"><a href="javascript:verCuentaCatalogo('<%= cta.getId() %>')"><%= cta.getNombre() %></a></span></li>
					<%	
				}
				%>
					</ul>
				</li>
				<%
				
			
			}
			%>
			</ul>
			</li>
			<li> <span class="file"><a href="javascript:verCuentaCatalogo('0')">Libro Diario</a></span></li>
			</ul>
		</td>
		<td valign="top">
			<div id="visorCuentaEnCatalogo" style="overflow: scroll; width: 750px; height: 300px;"></div>
		</td>
	</tr>
	</table>


	
  </body>
</html> 
